package CheckParam;
# by Tao Lang: langtao123xxx@126.com
use strict;
use warnings;
use Scalar::Util qw/looks_like_number/;

use Mojo::Base 'Exporter';

our @EXPORT_OK = qw/is_valid_numeric_param/;

sub is_valid_numeric_param {
    my($pVal, $min, $max) = @_;
    return 0 unless (defined $pVal);
    return 0 unless (looks_like_number($pVal));
    return 0 unless ($pVal >= $min and $pVal <= $max);
    return 1;
}

1;
